package nl.blindwars.mapeditor.gui;

import java.awt.Point;

import javax.swing.JLabel;

public class StatusBar extends MyJPanel {
	private static final long serialVersionUID = 540923822881156212L;

	JLabel message;
	JLabel mouseCoordinates;
	
	public StatusBar(int width) {
		super();
		
		setSize(width, 32);
		
		setOpaque(true);
		
		init();
	}
	
	private void init() {
		message = new JLabel("Welcome to the map editor.");
		mouseCoordinates = new JLabel("( - x - )");
		
		message.setFont(font);
		mouseCoordinates.setFont(font);
		
		add(message);
		add(mouseCoordinates);
	}
	
	public void setMessage(String msg) {
		message.setText(msg);
	}
	
	public void clearMessage() {
		message.setText("");
	}

	public void setMouseCoordinates(Point p) {
		mouseCoordinates.setText("(" + p.x + " x " + p.y + ")");
	}
}
